<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>学校信息</title>
	<meta name="decorator" content="default"/>
<script src="${ctxStatic}/front/js/myValidate.js"></script> 
	<script type="text/javascript">
		$(document).ready(function() {
			$("#inputForm").validate(
			{
				rules:
					{
					contactPhone : {
						required: true,
						minlength : 10,
						maxlength : 13,
						isPhone:true
					     		}		
					},
					messages:
						{
						contactPhone : {
							required: '请填写联系电话',
							minlength : '固话为区号(3-4位)号码(7-9位)',
							maxlength : '固话最多为12位'
						}
					},
				submitHandler: function(form){
					loading('正在提交，请稍等...');
					form.submit();
				},
				errorContainer: "#messageBox",
				errorPlacement: function(error, element) {
					$("#messageBox").text("输入有误，请先更正。");
					if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
						error.appendTo(element.parent().parent());
					} else {
						error.insertAfter(element);
					}
				}
			});
		});
	</script>
</head>
<body>
	<ul class="nav nav-tabs">
		<li><a href="${ctx}/dd/ddSchool/">学校列表</a></li>
		<li class="active"><a href="${ctx}/dd/ddSchool/form?id=${ddSchool.id}">学校
		<shiro:hasPermission name="dd:ddSchool:edit">${not empty ddSchool.id?'修改':'添加'}</shiro:hasPermission>
		<shiro:lacksPermission name="dd:ddSchool:edit">查看</shiro:lacksPermission></a></li> 
	</ul><br/>
	<form:form id="inputForm" modelAttribute="ddSchool" action="${ctx}/dd/ddSchool/save" method="post" class="form-horizontal">
		<form:hidden path="id"/>
		<sys:message content="${message}"/>		
		<div class="control-group">
			<label class="control-label">
			<b style="color: red; font-size: large">*</b>校名：</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="50" class="input-xlarge " required="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">
			<b style="color: red; font-size: large">*</b>地址：</label>
			<div class="controls">
				<form:input path="address" htmlEscape="false" maxlength="100" class="input-xlarge " required="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">
			<b style="color: red; font-size: large">*</b>负责人：</label>
			<div class="controls">
				<form:input path="director" htmlEscape="false" maxlength="50" class="input-xlarge " required="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">
			<b style="color: red; font-size: large">*</b>联系人姓名：</label>
			<div class="controls">
				<form:input path="contactName" htmlEscape="false" maxlength="50" class="input-xlarge " required="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">
			<b style="color: red; font-size: large">*</b>联系人电话：</label>
			<div class="controls">
				<form:input path="contactPhone" placeholder="例如:0000-00000000" htmlEscape="false" class="input-xlarge " required="required"/>
			</div>
		</div>
		<div class="form-actions">
			<shiro:hasPermission name="dd:ddSchool:edit"><input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>&nbsp;</shiro:hasPermission>
			<input id="btnCancel" class="btn" type="button" value="返 回" onclick="history.go(-1)"/>
		</div>
	</form:form>
</body>
</html>